<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加生产计划</title>
</head>
<style>
    @import url("//unpkg.com/element-ui@2.15.7/lib/theme-chalk/index.css");
</style>
<body>
<!--<script src="//unpkg.com/vue/dist/vue.js"></script>-->
<!--<script src="//unpkg.com/element-ui@2.15.7/lib/index.js"></script>-->
<div id="app">
    <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="计划名称">
            <el-input v-model="form.name"></el-input>
        </el-form-item>

        <el-form-item label="计划描述">
            <el-input v-model="form.description"></el-input>
        </el-form-item>
        <el-form-item label="开始时间">
            <el-col :span="11">
                <el-date-picker type="date" placeholder="选择日期" v-model="form.startTime" style="width: 100%;"></el-date-picker>
            </el-col>
        </el-form-item>

        <el-form-item label="结束时间">
            <el-col :span="11">
                <el-date-picker type="date" placeholder="选择日期" v-model="form.endTime" style="width: 100%;"></el-date-picker>
            </el-col>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">立即创建</el-button>
            <el-button>取消</el-button>
        </el-form-item>
    </el-form>
</div>

</body>
<!--vue的库的引入-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!--axios的引入-->
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- script -->
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<script>
    var Main = {
        data() {
            return {
                form: {
                    name: '',
                    description: '',
                    startTime: '',
                    endTime: ''
                }
            }
        },
        methods: {
            onSubmit() {
                console.log(this.form);
                axios.post("http://47.108.224.192:8081/plan/add",this.form).then(res=>{
                    console.log(res);
                })
            }
        }
    }
    var Ctor = Vue.extend(Main)
    new Ctor().$mount('#app')

</script>

</html>